package com.b.domain;

import java.util.Date;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

/**
 * 管理员表
 */
@Document(indexName = "admin")
@Data
@AllArgsConstructor
@NoArgsConstructor
public class Admin {
    /**
     * 管理员ID
     */
    @Id
    @Field(type = FieldType.Integer, index = true , store = true)
    private Integer id;
    /**
     * 用户名
     */
    @Field(type = FieldType.Text, index = true , store = true, analyzer = "ik_max_word")
    private String username;

    /**
     * 加密后密码
     */
    @Field(type = FieldType.Text, index = true , store = true, analyzer = "ik_max_word")
    private String passwordHash;

    /**
     * 邮箱
     */
    @Field(type = FieldType.Text, index = true , store = true, analyzer = "ik_max_word")

    private String email;

    /**
     * 手机号
     */
    @Field(type = FieldType.Text, index = true , store = true, analyzer = "ik_max_word")
    private String phone;

    /**
     * 创建时间
     */
    @Field(type = FieldType.Date, index = false , store = true)
    private Date createTime;
}